﻿using System.Web.Http;
using System.Web.Mvc;

namespace CNKI.TPI.Web.Interface.Areas.Resource
{
    public class ResourceAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Resource";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                name: "Resource_default",
                routeTemplate: "api/Resource/{controller}/{action}/{id}",
                defaults: new
                {
                    action = RouteParameter.Optional,
                    id = RouteParameter.Optional,
                    namespaceName = new string[] { string.Format("CNKI.TPI.Web.Interface.Areas.{0}.Controllers", this.AreaName) }
                }
            );
        }
    }
}
